<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.petcommunity.model.Notice" %>
<%
    Notice notice = (Notice) request.getAttribute("entity");
%>

<html>
<head>
    <title>编辑通知公告</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">

<style>
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    body {
        font-family: 'Microsoft YaHei', sans-serif;
        background: url('../system_war/imgs/2.png') no-repeat center center fixed;
        background-size: cover;
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        position: relative;
    }

    body::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.3);
        z-index: 1;
    }

    .edit-container {
        width: 100%;
        max-width: 600px;
        background: white;
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
        overflow: hidden;
        animation: fadeInUp 0.8s ease-out;
        position: relative;
        z-index: 2;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    h2 {
        background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
        color: white;
        text-align: center;
        padding: 30px;
        margin: 0;
        font-size: 1.8rem;
        font-weight: 600;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        position: relative;
        overflow: hidden;
    }

    h2::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
        animation: float 6s ease-in-out infinite;
    }

    @keyframes float {
        0%, 100% { transform: translateY(0px) rotate(0deg); }
        50% { transform: translateY(-20px) rotate(180deg); }
    }

    form {
        padding: 40px;
        background: white;
    }

    .form-group {
        margin-bottom: 25px;
        position: relative;
    }

    .form-group label {
        display: block;
        margin-bottom: 8px;
        color: #555;
        font-weight: 500;
        font-size: 1rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        padding: 15px 20px;
        border: 2px solid #E8E8E8;
        border-radius: 10px;
        font-size: 1rem;
        transition: all 0.3s ease;
        background: #F8F9FA;
        font-family: 'Microsoft YaHei', sans-serif;
    }

    .form-group textarea {
        min-height: 120px;
        resize: vertical;
    }

    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
        outline: none;
        border-color: #FF6B6B;
        background: white;
        box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
    }

    .form-group input::placeholder,
    .form-group textarea::placeholder {
        color: #999;
    }

    /* 为不同类型的输入框添加图标 */
    .form-group:has(input[type="text"]) label::before {
        content: '📝 ';
        color: #FF6B6B;
    }

    .form-group:has(input[type="number"]) label::before {
        content: '🔢 ';
        color: #FF6B6B;
    }

    .form-group:has(input[type="date"]) label::before {
        content: '📅 ';
        color: #FF6B6B;
    }

    .form-group:has(textarea) label::before {
        content: '📄 ';
        color: #FF6B6B;
    }

    input[type="submit"] {
        width: 100%;
        padding: 15px;
        background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
        color: white;
        border: none;
        border-radius: 10px;
        font-size: 1.1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-top: 20px;
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    }

    input[type="submit"]:hover {
        background: linear-gradient(135deg, #FF5252 0%, #FF7575 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    }

    input[type="submit"]:active {
        transform: translateY(0);
    }

    /* 装饰性元素 */
    .decorative-paws {
        position: absolute;
        font-size: 1.2rem;
        color: rgba(255, 107, 107, 0.2);
        animation: rotate 8s linear infinite;
    }

    .paw-1 {
        top: 20px;
        right: 30px;
        animation-delay: 0s;
    }

    .paw-2 {
        bottom: 30px;
        right: 20px;
        animation-delay: 2s;
    }

    .paw-3 {
        top: 50%;
        right: 10px;
        animation-delay: 4s;
    }

    @keyframes rotate {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }

    /* 返回按钮样式 */
    .back-btn {
        display: inline-block;
        margin: 20px 40px 0;
        padding: 10px 20px;
        background: #6C757D;
        color: white;
        text-decoration: none;
        border-radius: 8px;
        font-size: 0.9rem;
        transition: all 0.3s ease;
    }

    .back-btn:hover {
        background: #5A6268;
        transform: translateY(-1px);
    }

    /* 响应式设计 */
    @media (max-width: 768px) {
        .edit-container {
            margin: 10px;
        }

        form {
            padding: 30px 20px;
        }

        h2 {
            font-size: 1.5rem;
            padding: 25px 20px;
        }
    }

    /* 隐藏字段样式 */
    input[type="hidden"] {
        display: none;
    }

    /* 表单验证提示 */
    .form-group input:invalid,
    .form-group textarea:invalid {
        border-color: #FF6B6B;
    }

    .form-group input:valid,
    .form-group textarea:valid {
        border-color: #28A745;
    }
</style>
</head>
<body>
    <div class="edit-container">
        <h2>编辑通知公告</h2>

        <form action="../system_war/editSubmit" method="post">
            <input type="hidden" name="type" value="notice">
            <input type="hidden" name="id" value="<%=notice.getNoticeId()%>">

            <div class="form-group">
                <label for="title">标题</label>
                <input type="text" id="title" name="title" value="<%=notice.getTitle()%>" required>
            </div>

            <div class="form-group">
                <label for="content">内容</label>
                <textarea id="content" name="content" required><%=notice.getContent()%></textarea>
            </div>

            <div class="form-group">
                <label for="publishDate">发布时间</label>
                <input type="date" id="publishDate" name="publishDate" value="<%=notice.getCreatedAt()%>" required>
            </div>

            <input type="submit" value="💾 保存修改">
        </form>

        <a href="javascript:history.back()" class="back-btn">
            <i class="fas fa-arrow-left"></i> 返回
        </a>

        <!-- 装饰性爪印 -->
        <i class="fas fa-paw decorative-paws paw-1"></i>
        <i class="fas fa-paw decorative-paws paw-2"></i>
        <i class="fas fa-paw decorative-paws paw-3"></i>
    </div>
</body>
</html>